package com.jwtproject.bootserver.controller;

import com.baomidou.mybatisplus.plugins.Page;
import com.jwtproject.bootserver.model.User;
import com.jwtproject.bootserver.security.util.SecurityUtil;
import com.jwtproject.bootserver.status.ProjectStatusEnum;
import com.jwtproject.bootserver.util.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin")
public class AdminController {


    @GetMapping("hello")
    public Result hello(){
        return new Result(ProjectStatusEnum.SUCCESS,"admin,hello");
    }

    @GetMapping("getUserTest")
    public Result getUserTest(){
        return new Result(ProjectStatusEnum.SUCCESS, SecurityUtil.getUser());
    }

    @GetMapping("getUserList")
    public Result getUserList(){
        return new Result(ProjectStatusEnum.SUCCESS, SecurityUtil.getRoles());
    }
}
